package com.cet.designpatterns.observer.improvement;

/**
 * @program: algorithm
 * @description:
 * @author: 陈恩涛
 * @create: 2021-09-22 15:16
 **/
public class Client {
    public static void main(String[] args) {
        WeatherData weatherData = new WeatherData();
        CurrentConditions currentConditions = new CurrentConditions();
        Baidu baidu = new Baidu();
        weatherData.registerObserver(currentConditions);
        weatherData.registerObserver(baidu);
        weatherData.setData(30, 150, 40);
        System.out.println("--------------------------------------");
        weatherData.removeObserver(currentConditions);
        weatherData.setData(27, 140, 39);

    }
}
